* Nicholas Jacobs and B. Kal Munis *
* Place Based Imagery and Voter Evaluations*

clear
set more off
cd "/Users/nfj/Dropbox/Place Experiments/Place Based Appeals/Data/Data for Open Source"
use "Place Based Imagery and Voter Evaluations.dta"
set scheme s1mono


save "Place Based Imagery and Voter Evaluations.dta", replace

*** AVERAGE TREATMENT EFFECTS ***
reg thermo ib3.treatment i.rural
margins, dydx(treatment)

	
*** HETEROGENOUS TREATMENT EFFECTS ***

reg thermo ib3.treatment##c.placeprecep i.rural // base is the control group
margins, dydx(treatment) at(placeprecep=(1 2 3 4 5 6))

logit favor ib2.treatment##c.placeprecep i.rural
margins, dydx(treat) at(placeprecep=(1 2 3 4 5 6))

xtlogit favor ib2.treatment##c.placeprecep pid ideo sex educ i.rural, fe i(state) 

*CANDIDATE TRAITS

reg values  ib3.treatment##c.placeprecep i.rural // base is the control group
margins, dydx(treatment) at(placeprecep=(1(1)6))


reg understand  ib2.treatment##c.placeprecep i.rural // base is the control group **** THIS IS MODEL
margins, dydx(treatment) at(placeprecep=(1(1)6)) level(95)

reg trust  ib2.treatment##c.placeprecep i.rural age south pid sex race educ ideol longage // base is the control group
margins, dydx(treatment) at(placeprecep=(1(1)6))

reg help  ib2.treatment##c.placeprecep i.rural age south pid sex race educ ideol longage // base is the control group
margins, dydx(treatment) at(placeprecep=(1(1)6))

reg proud  ib2.treatment##c.placeprecep age south pid sex race educ ideol longage // base is the control group
margins, dydx(treatment) at(placeprecep=(1(1)6))

* State Heterogeneity 
xtlogit favor ib2.treatment##c.placeprecep pid ideo sex educ i.rural, fe i(state) 

gen region = .
replace region = 1 if south==1
replace region = 2 if northeast==1
replace region = 3 if west==1
replace region = 4 if midwest==1
label define region 1 "South" 2 "Northeast" 3 "West" 4 "Midwest"
label values region region

gen match =0
replace match = 1 if treatment==1&placeprecep<=3
replace match = 1 if treatment==2&placeprecep>=4

